package com.hhkj.admin.course.domain;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BizBaseEntity;
import com.ruoyi.common.valid.VAdd;
import com.ruoyi.common.valid.VDisable;
import com.ruoyi.common.valid.VEdit;
import com.ruoyi.common.valid.VList;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 课程题库类型对象 t_course_bank_type
 *
 * @author ruoyi
 * @since 2023-05-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_course_bank_type")
public class CourseBankType extends BizBaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 名称 */
    @Excel(name = "名称")
    @NotBlank(message = "名称不能为空" , groups = {VAdd.class, VEdit.class})
    private String name;

    /** 排序序号 */
    @Excel(name = "排序序号")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer orderNum;

    /** 课程id 关联 t_course 表的 id 字段 */
    @Excel(name = "课程id 关联 t_course 表的 id 字段")
    @NotNull(message = "对应课程不能为空" , groups = {VAdd.class, VList.class})
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Long courseId;

    /** 禁用标签 0-否 1-是 默认0 */
    @Excel(name = "禁用标签 0-否 1-是 默认0")
    @NotNull(message = "对应课程不能为空" , groups = {VDisable.class})
    private Integer disableFlag;

    /** 禁用标签 0-否 1-是 默认0 */
    @Excel(name = "是否默认题库 0-否 1-是 默认0")
    private Integer defaultFlag;

    /** 禁用标签 0-否 1-是 默认0 */
    @Excel(name = "是否免费 0-否 1-是 默认0")
    private Integer freeFlag;

    /** 科目id */
    @TableField(exist = false)
    private Long courseChildId;

    @Override
    @NotNull(message = "唯一主键不能为空" , groups = {VEdit.class, VDisable.class})
    public Long getId()
    {
        return super.getId();
    }
}
